package model.data.Interface;

import java.net.InetAddress;
import java.util.Iterator;

import model.entity.User;

/**
 * @author Christelle SIAGO HAPPI Project ChatSystemG6 - INSA 4INFOA1 -
 *         2013/2014 
 *<li>The interface of the userList allow to add or remove a user in the list</li>
 * @see userList
 */

public interface UserListInterface {

	/**
	 * add a remote user in the collection
	 * 
	 * @param user
	 *            : the user to add
	 */
	public void addUser(User user);

	/**
	 * removes the remote user in the collection
	 * 
	 * @param user
	 *            : the remote user to remove
	 */
	public void removeUser(User user);

	/**
	 * removes all the remote users from the collection
	 */
	public void removeAll();

	/**
	 * gets the login of a user via his username
	 * 
	 * @param adresse
	 *            : the IP address of the remote user
	 * @return the Login of the remote user who corresponds to the IP address
	 */
	public String getUserName(InetAddress adresse);

	/**
	 * gets the IP address of a remote user
	 * 
	 * @param name
	 *            : the name of the remote user that we are looking for his IP
	 *            address
	 * @return the IP address of the remote user which match his login
	 */
	public InetAddress getUserAddress(String name);

	/**
	 * 
	 * @param name
	 * @return
	 */
	public User getUserByName(String name);

	/**
	 * 
	 * @param adresse
	 * @return
	 */

	public User getUserByAdress(InetAddress adresse);
	
	/**
	 * verify if the username is already in the list
	 * @param name
	 * @return
	 */
	
	 public boolean containsName(String name);

	/**
	 * 
	 * @return the iterator of the collection
	 */

	
	 
	public Iterator iterator();

}